const app = getApp()
const session = {
  getSession(){
    let session = app.globalData.session_key
    if (!session){
      session = app.globalData.session_key = wx.getStorageSync('session_key')
    }
    return session
  },
  saveSession(session){
    app.globalData.session_key = session
    wx.setStorageSync("session_key", session)
  },
  deleteSession(){
    app.globalData.session_key = null
    wx.removeStorageSync('session_key')
  }
}
module.exports=session